package com.example.xd.javatest.jvm_test;

/**
 * @auther XuDan on 2020/6/17.
 * StackOverflowError
 */
public class JavaVMStackSOF {
    private int stackLength = 1;

    public void stackLeak() {
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) {
        JavaVMStackSOF oom = new JavaVMStackSOF();
        try {
            oom.stackLeak();

        } catch (Throwable e) {
            System.out.println("------------" + oom.stackLength);
            throw e;
        }
    }
}
